﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EntLibEC.Biz;
using EntLibEC.Cmn;

namespace EntLibEC.View.Cmn
{
    public partial class PagePosition : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void BindPagePosition(bool isAll)
        {
            ddlPagePosition.Items.Clear();
            ddlPagePosition.DataSource = AppEnum.GetPagePosition();
            ddlPagePosition.DataValueField = "key";
            ddlPagePosition.DataTextField = "value";
            ddlPagePosition.DataBind();
            if (isAll)
                ddlPagePosition.Items.Insert(0, new ListItem(AppConst.AllSelectString, AppConst.IntNull.ToString()));
        }


        public int PagePositionSysNo
        {
            get
            {
                return Convert.ToInt32(ddlPagePosition.SelectedItem.Value);
            }
            set
            {
                ddlPagePosition.SelectedIndex = ddlPagePosition.Items.IndexOf(ddlPagePosition.Items.FindByValue(value.ToString()));
            }
        }
    }
}